// pages/detail/detail.js
import { wxRequest } from "../../utils/ajax";
Page({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    article: {},//订单详情信息
    artId: '',//订单ID
  },
  onLoad: function (options) {
    var that = this;
    console.log(options);
    that.setData({
      artId: options.artId
    })
  },
   onShow: function () {
    var that = this;
    if (that.data.artId != undefined && that.data.artId!=""){
      wxRequest('/aArticle/detail', {
        artId: that.data.artId
      }, function (data) {
        that.setData({
          item: data.data.data,
        });
      });
    }
  },
  joinArticle(e){
   let artid= e.currentTarget.dataset.id
    if (artid != undefined && artid != "") {
      wxRequest('/aArticle/join', {
        artId: artid
      }, function (data) {
         
      });
    }
  }
})
